<?php if (!defined('THINK_PATH')) exit(); /*a:2:{s:68:"C:\xampp\htdocs\game\douniu1/application/game\view\result\index.html";i:1506921511;s:77:"C:\xampp\htdocs\game\douniu1/application/game\view\douniuplaywjy\ranking.html";i:1506861099;}*/ ?>
<!DOCTYPE>
<html>
<head>
    <title></title>
    <meta http-equiv="Content-Type" content="text/html;charset=utf-8">
    <meta name="viewport" content="width=device-width,initial-scale=1,maximum-scale=1,user-scalable=no">
    <meta http-equiv="X-UA-Compatible" content="IE=Edge，chrome=1">
    <meta name="description" content="不超过150个字符"/>
    <meta name="keywords" content="">
    <meta name="format-detection" content="telephone=no">
    <meta name="robots" content="index,follow"/>
    <meta name="renderer" content="webkit">
    <meta http-equiv="Cache-Control" content="no-siteapp">
    <meta name="HandheldFriendly" content="true">
    <meta name="msapplication-tap-highlight" content="no">
    <meta name="apple-mobile-web-app-capable" content="yes">
    <meta name="apple-mobile-web-app-status-bar-style" content="black">
    <!-- <link rel="stylesheet" type="text/css" href="__STATIC__/game/css/play.css"> -->
    <style>
        *{margin:0;padding: 0;}
        body{background: #140C09;}
        body>img{position: absolute;top:0;left: 0;width: 100%;z-index: -1;}
        .content{width: 74%;margin-left: 13%;margin-top: 30%;text-align: center;}
        .times{display: inline-block;background:#5B5211; border-radius: 0.6rem;height: 1.2rem;line-height:1.2rem;font-size: 0.4rem;color:#D6BC71;padding: 0 0.3rem;border:1px solid #ccc;}
        ul{width: 90%;margin-left: 5%;margin-top: 1.2rem;}
        ul li{background:#1C1606;color: white;list-style: none;width: 96%;margin-left: 2%;margin-top:.2rem;height: 1.8rem;line-height: 1.8rem;font-size: 1rem;opacity: 0.9;}
        ul li span:first-child{float: left;margin-left: 1rem;max-width: 8rem;overflow: hidden; text-overflow:ellipsis;white-space:nowrap;}
        ul li span:last-child{float: right;margin-right: 1rem;}
        .add{color:#F5D203!important;}
        .win{background: url(__STATIC__/game/img/win.png) left top no-repeat;background-size: 12%;}
        
    </style>
    <!--[if lt IE 9]>
    <script src="https://oss.maxcdn.com/libs/html5shiv/3.7.0/html5shiv.js"></script>
    <script src="https://oss.maxcdn.com/libs/respond.js/1.3.0/respond.min.js"></script>
    <![endif]-->
</head>
<body onclick="mp3play('bau');">
<img src="__STATIC__/game/img/list.png"><div class="content">
    <p class="times">房间号：<span ><?php echo $room['room_num']; ?></span><span><?php echo date('Y-m-d H:i',$room['taipaitime']); ?></span></p>
    <ul>



<?php if(is_array($list) || $list instanceof \think\Collection || $list instanceof \think\Paginator): $i = 0; $__LIST__ = $list;if( count($__LIST__)==0 ) : echo "" ;else: foreach($__LIST__ as $key=>$vo): $mod = ($i % 2 );++$i;?>
    
        <li class="<?php if($vo['money'] > '0'): ?>add<?php endif; if($key == '0'): ?> win<?php endif; ?>"><span><?php echo $vo['nickname']; ?></span><span><?php if($vo['money'] > '0'): ?>+<?php else: ?>-<?php endif; ?><?php echo abs($vo['money']); ?> </span></li>


<?php endforeach; endif; else: echo "" ;endif; ?>
<!--     <li class=""><span>gg刚刚</span><span></span></li>
    <li class=""><span>gg刚刚</span><span></span></li>
    <li class=" "><span>gg刚刚</span><span></span></li>
    <li class=""><span>gg刚刚</span><span></span></li>
    <li class=""><span>gg刚刚</span><span></span></li>
    <li class=" "><span>gg刚刚</span><span></span></li>
    <li class=""><span>gg刚刚</span><span></span></li>
    <li class=""><span>gg刚刚</span><span></span></li>
    <li class=""><span>gg刚刚</span><span></span></li> -->


    </ul>
</div>
<img id="down_img" style="width: 100%;border:none; position: absolute; top: 0; left: 0; bottom:0; right:0; z-index: 90000;" src="">
<!-- <script src="__STATIC__/game/js/jquery-1.12.1.js"></script> -->
<script src="__STATIC__/game/js/html2canvashq.js"></script>
<!-- <script>
var dom=$("body");
    var width = dom.width();
    var height = dom.height();
    var type = "png";
    var scaleBy = 10;
    var canvas = document.createElement('canvas');
    canvas.width = width * scaleBy;
    canvas.height = height * scaleBy+35;
    canvas.style.width = width * scaleBy + 'px';
    canvas.style.height = height * scaleBy + 'px';
    var context = canvas.getContext('2d');
    context.scale(scaleBy, scaleBy);
    html2canvas(dom[0], {
        canvas:canvas,
        onrendered: function (canvas) {
            $('#down_img').attr( 'src' , canvas.toDataURL() );
        }
    });
</script> -->

<script>

//定义查找元素方法
function $(selector) {
return document.querySelector(selector);
}
var main = {

//获取像素密度
getPixelRatio:function(context){
var backingStore = context.backingStorePixelRatio ||
context.webkitBackingStorePixelRatio ||
context.mozBackingStorePixelRatio ||
context.msBackingStorePixelRatio ||
context.oBackingStorePixelRatio ||
context.backingStorePixelRatio || 1;
return (window.devicePixelRatio || 1) / backingStore;
},
//绘制dom 元素，生成截图canvas
html2Canvas: function () {
var shareContent = $("body");// 需要绘制的部分的 (原生）dom 对象 ，注意容器的宽度不要使用百分比，使用固定宽度，避免缩放问题
var width = shareContent.offsetWidth;  // 获取(原生）dom 宽度
var height = shareContent.offsetHeight; // 获取(原生）dom 高
var offsetTop = shareContent.offsetTop;  //元素距离顶部的偏移量

var canvas = document.createElement('canvas');  //创建canvas 对象
var context = canvas.getContext('2d');
var scaleBy = main.getPixelRatio(context);  //获取像素密度的方法 (也可以采用自定义缩放比例)
canvas.width = width * scaleBy;   //这里 由于绘制的dom 为固定宽度，居中，所以没有偏移
canvas.height = (height + offsetTop) * scaleBy+200;  // 注意高度问题，由于顶部有个距离所以要加上顶部的距离，解决图像高度偏移问题(height + offsetTop) * scaleBy
context.scale(scaleBy, scaleBy);

var opts = {
allowTaint:true,//允许加载跨域的图片
tainttest:true, //检测每张图片都已经加载完成
scale:scaleBy, // 添加的scale 参数
canvas:canvas, //自定义 canvas
logging: true, //日志开关，发布的时候记得改成false
width:width, //dom 原始宽度
height:height //dom 原始高度
};
html2canvas(shareContent, opts).then(function (canvas) {
    $('#down_img').attr( 'src' , canvas.toDataURL());    
    // $('.content').parentElement.removeChild($('.content'))
});
}
};

//最后运行代码
main.html2Canvas();

</script>






<script src="__STATIC__/game/js/jquery-1.12.1.js"></script>
<audio id="bau" autoplay="autoplay" loop="loop" src="__STATIC__/game/video/background.mp3"></audio>

<script>
    function mp3play(id){
        document.getElementById(id).play();
    }




</script>
</body>
</html>
